﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using WindowsFormsTest.Public;

namespace WindowsFormsTest.Sell
{
    public partial class SellOrderManager : MainTabUserContorl
    {
        string[][] initData = new string[][] { new string[] { "00-111222-3344", "汉光电器", "陈金", "20120103样品", "100.9000", "2012-1-1", "2011-12-3", "陈静", "可用", "未冻结" }, new string[] { "00-111222-3355", "魁金电子", "王好", "20120103样品", "2200.9000", "2012-1-1", "2011-12-3", "陈静", "审批中", "未冻结" } };


        public SellOrderManager()
        {
            InitializeComponent();


            this.dataGridView1.Rows.Add();
            this.dataGridView1.Rows.Add();
            for (int i = 0; i < initData.Length; i++)
            {
                for (int j = 0; j < initData[0].Length; j++)
                {
                    this.dataGridView1.Rows[i].Cells[j].Value = initData[i][j];
                }

            }
        }
        public override void SetModel(WindowsFormsTest.Public.WindowModel modelType)
        {
            switch (modelType)
            {
                case WindowModel.MANAGER_SEARCH:
                    {
                        this.splitContainer2.Panel1Collapsed = true;
                        break;
                    }
                default:
                    {
                        break;
                    }
            }
        }
      
        private void button10_Click(object sender, EventArgs e)
        {
            if (this.MainForm.isOpenTab(Operator.GetOperatorLabelText(OperatorLabelEnum.ORDER_ADD)))
            {
                return;
            }
            SellOrderAdd pp = new SellOrderAdd();

            Operator.Create_MainTabPage(OperatorLabelEnum.ORDER_ADD, pp, WindowModel.DEFAULT, this.MainForm);
          

         
        }

        private void button9_Click(object sender, EventArgs e)
        {
            this.splitContainer1.Panel2Collapsed = true;
        }

        private void button7_Click(object sender, EventArgs e)
        {
            this.splitContainer1.Panel2Collapsed = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.splitContainer1.Panel2Collapsed = false;
        }

        private void button9_Click_1(object sender, EventArgs e)
        {
            this.splitContainer1.Panel2Collapsed = true;
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            SellOrderAuditForm af = new SellOrderAuditForm();
            af.ShowDialog();
        }
    }
}
